//
//  YsResultModel.m
//  YsCloudFileManageSDK
//
//  Created by 宋宏康 on 2020/2/24.
//

#import "YsToolsManagerResultModel.h"
#import <YYModel/YYModel.h>
#import <YYCategories/YYCategories.h>

@interface YsToolsManagerResultModel() <YYModel>

@end

@implementation YsToolsManagerResultModel

/// yymodel 协议的属性映射
+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper
{
    return @{@"msg":@[@"errorMsg",@"message",@"msg",@"errormsg",@"errorMsg",@"successMsg",@"successmsg"],
             @"code":@[@"success",@"code",@"status"],
             @"data":@[@"result",@"data",@"model.list",@"model"]
    };
}

- (BOOL)isSuccessful
{
    if ([_code intValue] == 1 || [_code intValue] == 200) {
        return YES;
    }else{
        return NO;
    }
}

- (NSString *)msg
{
    if (_msg.isNotBlank) {
        return _msg;
    }else{
        return @"msg没有映射成功";
    }
}

@end
